package crp.core.portal.app;

import crp.core.portal.domain.services.PortalSectionCourseLoadDispatcher;
import crp.core.portal.domain.services.PortalSectionEditor;
import crp.core.portal.domain.services.PortalSectionSearcher;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

@ApplicationScoped
public class PortalSectionService {
    private final Instance<PortalSectionSearcher> searcher;
    private final Instance<PortalSectionEditor> editor;
    private final Instance<PortalSectionCourseLoadDispatcher> courseLoader;

    @Inject
    public PortalSectionService(Instance<PortalSectionSearcher> searcher,
                                Instance<PortalSectionEditor> editor,
                                Instance<PortalSectionCourseLoadDispatcher> courseLoader) {
        this.searcher = searcher;
        this.editor = editor;
        this.courseLoader = courseLoader;
    }

    public PortalSectionSearcher searcher() {
        return searcher.get();
    }

    public PortalSectionEditor editor() {
        return editor.get();
    }

    public PortalSectionCourseLoadDispatcher courseLoader() {
        return courseLoader.get();
    }
}
